package com.xyy.saas.payment.dao.mapper;

import com.xyy.saas.payment.dao.model.PayFinanceApply;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PayFinanceApplyMapper {
    int deleteByPrimaryKey(Long id);

    int insert(PayFinanceApply record);

    int insertSelective(PayFinanceApply record);

    PayFinanceApply selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(PayFinanceApply record);

    int updateByPrimaryKey(PayFinanceApply record);

    PayFinanceApply selectByThirdApplyNo(String thirdApplyNo);

    PayFinanceApply selectByLoanBalanceNo(String loanBalanceNo);

    List<PayFinanceApply> selectListByBusinessUserIdAndApplyStatus(@Param("businessUserId") String businessUserId,
                                                                   @Param("applyStatus") String applyStatus);

    PayFinanceApply findLatestRecord(@Param("businessUserId") String businessUserId, @Param("financeChannel") Integer financeChannel);
    PayFinanceApply findLatestRecordByLoanBalanceNo(@Param("loanBalanceNo") String loanBalanceNo, @Param("financeChannel") Integer financeChannel);
}